ELF := ordered_list.elf

CXXFLAGS := -Wall
CXXFLAGS += -Wextra
CXXFLAGS += -Weffc++
CXXFLAGS += -Wpedantic
CXXFLAGS += -Wshadow
CXXFLAGS += -Wcast-align
CXXFLAGS += -Wcast-qual
CXXFLAGS += -Wdouble-promotion
CXXFLAGS += -Wmissing-include-dirs

%.elf: %.cpp
	c++ -std=c++20 -g -pg $(CXXFLAGS) $< -o $@

all: $(ELF)

test_%: %.elf
	./$< < $*.in > $*.tmp && diff $*.ans $*.tmp

clean:
	rm -rf *.elf *.o *.out *.tmp

rebuild: clean all
